
<div class="x_panel">
  <div class="x_content" style="display: block;">
    <!--表格主体内容-->
    <div class="row-fluid">
      <form action="/order/index.html" method="get">
        <label class="control-label">订单号</label>
        <input type="text" class="form-control-new" name="form[order_no]" value="{if isset($query.order_no)}{$query.order_no}{/if}">
        <label class="control-label">商品号</label>
        <input type="text" class="form-control-new" name="form[goods_id]" value="{if isset($query.goods_id)}{$query.goods_id}{/if}">
        <label class="control-label">商品名称</label>
        <input type="text" class="form-control-new" name="form[goods_name]" value="{if isset($query.goods_name)}{$query.goods_name}{/if}">
        <label class="control-label">商品类型</label>
        <select  class="form-control-new" name="form[category_id]" >
          <option {if !isset($query.category_id) || $query.category_id==0}selected="selected"{/if} value="0">全部</option>
          {foreach $category AS $value}
          <option {if isset($query.category_id) && $query.category_id==$value.category_id}selected="selected"{/if} value="{$value.category_id}">{$value.category_name}</option>
          {/foreach}
        </select>
        <label class="control-label">订单状态</label>
        <select  class="form-control-new" name="form[order_status]" >
          <option {if !isset($query.order_status) || $query.order_status==-1}selected="selected"{/if} value="-1">全部</option>
          <option {if isset($query.order_status) && $query.order_status==1}selected="selected"{/if} value="1">下单成功</option>
          <option {if isset($query.order_status) && $query.order_status==0}selected="selected"{/if} value="0">下单失败</option>
          <option {if isset($query.order_status) && $query.order_status==4}selected="selected"{/if} value="4">订单关闭</option>
        </select>

        <label class="control-label">订单来源（商城ID）</label>
        <input type="text" class="form-control-new" name="form[mall_id]" value="{if isset($query.mall_id)}{$query.mall_id}{/if}">

        <label class="control-label">寄送状态</label>
        <select  class="form-control-new" name="form[shipping_status]" >
          <option {if !isset($query.shipping_status) || $query.shipping_status==-1}selected="selected"{/if} value="-1">全部</option>
          <option {if isset($query.shipping_status) && $query.shipping_status==1}selected="selected"{/if} value="1">已寄送</option>
          <option {if isset($query.shipping_status) && $query.shipping_status==0}selected="selected"{/if} value="0">待寄送</option>
        </select>

        <label class="control-label">下单时间</label>
        <input type="text"  name="form[order_start_time]" value="{if isset($query.order_start_time)}{$query.order_start_time}{/if}" placeholder="开始时间" id="J_dh_start" class="form-control-new" >
        <input type="text"  name="form[order_end_time]" value="{if isset($query.order_end_time)}{$query.order_end_time}{/if}" placeholder="结束时间" id="J_dh_end" class="form-control-new" >
        <label class="control-label">支付时间</label>
        <input type="text"  name="form[pay_start_time]" value="{if isset($query.pay_start_time)}{$query.pay_start_time}{/if}" placeholder="开始时间" id="J_dh_start1" class="form-control-new" >
        <input type="text"  name="form[pay_end_time]" value="{if isset($query.pay_end_time)}{$query.pay_end_time}{/if}" placeholder="结束时间" id="J_dh_end1" class="form-control-new" >

        <button name="submit" type="submit" class="btn btn-primary" value="search">查询</button>
        <button name="submit" value="export" type="submit" class="btn btn-primary" >导出</button>
      </form>


    </div>
    <br>
    <div class="cont">
      <table class="table table-bordered table-striped">
        <thead>
        <tr>
          <th width="100px">订单号</th>
          <th>支付渠道</th>
          <th>支付渠道订单号</th>
          <th>商品名称</th>
          <th>商品编号</th>
          <th>商品数量</th>
          <th>商品单价</th>
          <th>订单金额</th>
          <th>商品分类</th>
          <th>用户手机号</th>
          <th>身份证</th>
          <th>收货地址</th>
          <th>订单时间</th>
          <th>订单状态</th>
          <th>寄送状态</th>
          <th>退款状态</th>
          <th>用户留言</th>
        </tr>
        </thead>
        <tbody>
        {foreach $order.lists as $orderitem}
        <tr>
          <td>{$orderitem.order_no}</td>
          <td>{$orderitem.pay_type}</td>
          <td>{$orderitem.pay_no}</td>
          <td>{$orderitem.goods_name}</td>
          <td>{$orderitem.goods_id}</td>
          <td>{$orderitem.goods_num}</td>
          <td>{$orderitem.real_price}</td>
          <td>{$orderitem.order_amount}</td>
          <td>{$orderitem.category_name}</td>
          <td>{$orderitem.mobile}</td>
          <td>{$orderitem.id_card}</td>
          <td width="200px">{$orderitem.shipping_address}</td>
          <td>{$orderitem.order_time}</td>
          <td>
            {if $orderitem.order_status==0}待支付{elseif $orderitem.order_status==1}已付款{else}{/if}
          </td>
          <td>
            {if $orderitem.shipping_status==0}待寄送{elseif $orderitem.shipping_status==1}已寄送{/if}
          </td>
          <td>
            {if $orderitem.refund_status==0}不需退款{elseif $orderitem.refund_status==1}申请退款{elseif $orderitem.refund_status==2}退款中{elseif $orderitem.refund_status==3}拒绝退款{elseif $orderitem.refund_status==4}完成退款{/if}
          </td>
          <td>{$orderitem.user_remark}</td>
        </tr>
        {/foreach}
        </tbody>
      </table>
      <!--分页-->
      {Yii::$app->view->render('/com/pager.php',['pager'=>$order.pager])}

    </div>




  </div>
</div>

<script type="text/javascript" src="{$theme}/libs/js/datepicker/bootstrap-datetimepicker.min.js"></script>
<script>
    var startDate = $('#J_dh_start').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

    var endDate = $('#J_dh_end').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

    var startDate = $('#J_dh_start1').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

    var endDate = $('#J_dh_end1').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

</script>